
<!doctype html>
<html lang="en">
<head>
    <link>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Создать пост/запись</title>
    <script
            src="https://code.jquery.com/jquery-3.7.1.min.js"
            integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo="
            crossorigin="anonymous"></script>
</head>
<body>
<div>
<!--    <form action="some.php" method="post">-->

        <label>Заголовок:</label>
        <p><input type="text" name="title" placeholder="Введите название поста" class="title"></p>
        <p></p><label>Пост:</label></p>
        <p><textarea name="content"class="content">Пример текста</textarea></p>
        <button type="submit" class="send">Отправить</button>

<!--    </form>-->



    <script>
        $(document).ready(function(){
            $('button.send').on('click', function (){
                var titleVal = $('input.title').val();
                var contentVal = $('textarea.content').val();

                //
                $.ajax({
                    method: "POST",
                    url: "some.php",
                    data: { title: titleVal, content: contentVal }
                })
                    .done(function( msg ) {
                        //alert( "Data Saved: " + msg );
                    });
                $('input.title').val('');
                $('textarea.content').val('');

                })
            });
    </script>
</div>
</body>
</html>